<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
	<META NAME="AUTHOR" CONTENT="kejin">
	<META NAME="CREATED" CONTENT="20070402;17150100">
	<META NAME="CHANGEDBY" CONTENT="kejin">
	<META NAME="CHANGED" CONTENT="20071008;23542900">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.5in 11in; margin: 0.79in }
		P { margin-bottom: 0.08in }
		H2 { color: #000000 }
		H3 { color: #000000 }
		PRE { color: #000000 }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H2>PocoCapsule/C++ example: OASIS-OpenCSA Calculator 
</H2>
<P>Copyright(c) 2006 by <A HREF="http://www.pocomatic.com/">Pocomatic
Software</A>. All rights reserved. 
</P>
<P>This is a simple example of PocoCapsule/OpenCSA. The <A HREF="http://www.oasis-opencsa.org/">OASIS-OpenCSA</A>
(Open Composite Services Architecture, formerly known as OpenSOA
Service Component Architecture) is a component model for building
applications and systems using a Service-Oriented Architecture (SOA).
In PocoCapsule/C++, the OpenCSA framework is implemented as a domain
specific framework (DSF) on top of the core PocoCapsule/C++ IoC+DSM
framework. Therefore, the assembly schema/model used in this example
is the <A HREF="http://www.osoa.org/download/abttachments/35/SCA_AssemblyModel_V096.pdf">OASIS
OpenCSA assembly model (version 0.96)</A>.</P>
<P>This example is mainly to illustrate the use of &lt;wire&gt;
elements in OpenCSA assembly to wire component together. 
</P>
<H3>Source Files</H3>
<P><A HREF="server.C">server.C:</A> This is a simple container, used
to setup and assemble the OASIS-OpenCSA composite. It is notable that
this container itself neither contains code, nor links with
application specific bean implementations.</P>
<P><A HREF="Calculator.wsdl">Calculator.wsdl</A>: The definition of
the web service provided by the hello server. 
</P>
<P><A HREF="MyCalculatorImpl.h">MyCalculatorImpl.h</A>: This file
provides inline implementation of the POCO class MyHelloServiceImpl. 
</P>
<P><A HREF="server.config">server.config</A>: The Pococapsule Web
Service application descriptor that describes this example's Web
Service setup.</P>
<P><A HREF="calculator-by-wire.composite">calculator-by-wire.composite</A>
and <A HREF="calculator-by-ref.composite">calculator-by-ref.composite</A>:
Two different flavors of OASIS-OpenCSA assembly descriptors that
describes the wiring (connections) of components/ports in the
OASIS-OpenCSA composite. The first one uses the &lt;wire&gt; elements
to wire components, and the second one uses the &lt;reference&gt;
elements.</P>
<P STYLE="margin-bottom: 0in"><A HREF="setup.xml">setup.xml</A>: The
main setup descriptors that first loads the needed library (the one
contains component implementation classes) and then instantiates the
web service engine and wires (connects) the OASIS-OpenCSA composite
by importing the <A HREF="server.config">server.config</A> and
<A HREF="calculator-by-wire.composite">calculator-by-wire.composite</A>
(can be replaced with <A HREF="calculator-by-ref.composite">calculator-by-ref.composite</A>).</P>
<P STYLE="margin-bottom: 0in"><A HREF="client.C">client.C</A>: The
client application. 
</P>
<H3>Building this example</H3>
<P>To build this example, the environment variable POCOCAPSULE_DIR
should point to the PocoCapsule/C++ installed directory. Also, this
example assumes the <A HREF="http://www.systinet.com/products/ssc/overview">Systinet
server for C++</A> is installed and its runtime and development
environment (such as WASPC_HOME environment variable pointing to its
installation directory) are set properly according to its
specification. 
</P>
<P STYLE="font-weight: medium">Once the environment is set and
required Systinet server for C++ is installed and configured
accordingly, this example can be built by simply invoking gmake/make
on linux/unix or nmake on windows. 
</P>
<H3>Running this example</H3>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">Before
starting the server, make sure the LD_LIBRARY_PATH (on linux and
solaris) or the PATH (on windows) environment variable is set
correctly to include the ${POCOCAPSULE_DIR}/lib directory and <FONT FACE="Times New Roman">the
${WASPC_HOME}/lib directory</FONT>.</FONT></P>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">start
the hello service server as: </FONT>
</P>
<PRE STYLE="margin-left: 0.79in"><FONT FACE="Courier 10 Pitch"><B>prompt&gt;</B> server</FONT>
<FONT FACE="Courier 10 Pitch">...</FONT></PRE><P STYLE="margin-bottom: 0in">
<FONT FACE="Times New Roman">The, start the client:</FONT></P>
<PRE STYLE="margin-left: 0.79in"><FONT FACE="Courier 10 Pitch"><B>prompt&gt;</B> client [server-URL]</FONT>
<FONT FACE="Courier 10 Pitch">...</FONT></PRE><P STYLE="margin-bottom: 0.2in">
<FONT FACE="Times New Roman">Here, the server URL is (optional, if
client is on localhost): http://&lt;server-address&gt;:6070/CalculatorPort.</FONT></P>
<P STYLE="margin-bottom: 0.2in"><A HREF="../../README.html"><FONT FACE="Times New Roman">Back
to the root page</FONT></A></P>
</BODY>
</HTML>